<template>
    <a-modal v-model:visible="updateVisible" title="Basic Modal" @ok="handleOk">
        <a-form
            :model="student"
            name="update"
            :label-col="{ span: 8 }"
            :wrapper-col="{ span: 16 }"
            autocomplete="off"
            @finish="onFinish"
        >
            <a-form-item
                label="姓名"
                name="name"
                :rules="[{ required: true, message: '姓名不能为空' }]"
            >
                <a-input v-model:value="student.name" />
            </a-form-item>
            <a-form-item
                label="年龄"
                name="age"
                :rules="[{ required: true, message: '年龄不能为空' }]"
            >
                <a-input v-model:value="student.age" />
            </a-form-item>
            <a-form-item label="性别" name="gender">
                <a-radio-group v-model:value="student.gender" name="updateGender">
                    <a-radio value="男">男</a-radio>
                    <a-radio value="女">女</a-radio>
                </a-radio-group>
            </a-form-item>
        </a-form>
    </a-modal>
</template>

<script setup>
import useStudentStore from "../../store/student";
import { storeToRefs } from "pinia";
const studentStore = useStudentStore();
const { updateVisible,student } = storeToRefs(studentStore);
function handleOk() {
    updateVisible.value = false;
    console.log(student.value)
}
function onFinish(values){
    
}
</script>

<style>
</style>